#pragma once
#include <iostream>
#include <chrono>
#include <sys/timeb.h>
#include <sys/timerfd.h>

#define TIMER(f) do{\
    auto start = std::chrono::high_resolution_clock::now();\
    f; \
    auto end = std::chrono::high_resolution_clock::now();\
    auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);\
    std::cout << "执行时间: " << duration.count() << " 微秒" << std::endl;}while(0)

inline long GetMillitim()
{
    timeb t;
    ftime(&t);
    long now = t.time * 1000 + t.millitm;
    return now;
}

int CreateTimeoutfd(int iTimeoutVal);
int SetTimeout(int iTimefd, int iTimeout);
